package jsso;

import java.lang.reflect.Method;
import java.util.ArrayList;

import jsso.annotation.Service;

import org.red5.server.adapter.ApplicationAdapter;

public class Application extends ApplicationAdapter
{
    /**
     * Allows the javascript-client to retrieve a list of available methods
     */
    @Service
    public ArrayList<String> getServiceList() {
	    ArrayList<String> serviceMethods = new ArrayList<String>();
	    Method[] methods = this.getClass().getMethods();
		for (Method method : methods) {
			if (method.isAnnotationPresent(Service.class)) {
				serviceMethods.add(method.getName());
			}
		}
		return serviceMethods;
    }
}